package cn.zhqr.core.bean;

import cn.zhqr.common.bean.UserInfo;
import cn.zhqr.core.controller.base.BaseController;

/**
 * @Description 过户参数
 * @Author charles
 * @Date 2021/10/12 4:16 下午
 * @Version 1.0
 */
public class TransferParam {
    private Long device_id;//被操作设备id
    private Long user_id;//被过户的用户id
    private Long card_id;//被过户的电卡id

    private Long to_agent_id;//目标运营商id
    private Long to_device_id;//目标设备id
    private String content;//过户原因

    private boolean transfer_user;//是否迁移用户
    private boolean change_brand;//是否切换品牌
    private boolean clear_split;//是否清空设备分账
    private UserInfo userInfo;//当前操作人的信息


    public static TransferParam parseRequest(BaseController controller){
        TransferParam param = new TransferParam();
        if(controller!=null){
            param.setUser_id(controller.getParaToLong("user_id"));
            param.setDevice_id(controller.getParaToLong("device_id"));
            param.setCard_id(controller.getParaToLong("card_id"));

            param.setTo_agent_id(controller.getParaToLong("to_agent_id"));
            param.setTo_device_id(controller.getParaToLong("to_device_id"));
            param.setContent(controller.getPara("content"));
            param.setTransfer_user(!"0".equals(controller.getPara("transfer_user")));
            param.setClear_split(!"0".equals(controller.getPara("clear_split")));
            param.setChange_brand("1".equals(controller.getPara("change_brand")));
            param.setUserInfo(controller.getUserInfo());
        }
        return param;
    }

    public Long getDevice_id() {
        return device_id;
    }

    public void setDevice_id(Long device_id) {
        this.device_id = device_id;
    }

    public Long getUser_id() {
        return user_id;
    }

    public void setUser_id(Long user_id) {
        this.user_id = user_id;
    }

    public Long getCard_id() {
        return card_id;
    }

    public void setCard_id(Long card_id) {
        this.card_id = card_id;
    }

    public Long getTo_agent_id() {
        return to_agent_id;
    }

    public void setTo_agent_id(Long to_agent_id) {
        this.to_agent_id = to_agent_id;
    }

    public Long getTo_device_id() {
        return to_device_id;
    }

    public void setTo_device_id(Long to_device_id) {
        this.to_device_id = to_device_id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isTransfer_user() {
        return transfer_user;
    }

    public void setTransfer_user(boolean transfer_user) {
        this.transfer_user = transfer_user;
    }

    public boolean isChange_brand() {
        return change_brand;
    }

    public void setChange_brand(boolean change_brand) {
        this.change_brand = change_brand;
    }

    public boolean isClear_split() {
        return clear_split;
    }

    public void setClear_split(boolean clear_split) {
        this.clear_split = clear_split;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }
}
